package com.wn.consumer.demo08;

import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.*;
import org.springframework.stereotype.Component;

/**
 * @author yellow Docter
 * @date 2022 -11-04
 * @desc
 */
@Component
public class NormalConsumer {

    @RabbitListener(
            bindings = @QueueBinding(
                    value = @Queue(
                            name = "normal-queue",
                            arguments = {
                                    @Argument(name = "x-dead-letter-exchange",value = "dead-exchange"),
                                    @Argument(name = "x-dead-letter-routing-key",value = "dead.key"),
                                    @Argument(name = "x-message-ttl",value = "10000",type = "java.lang.Long"),
                                    @Argument(name = "x-max-length",value = "10",type = "java.lang.Long")
                            }
                    ),
                    exchange = @Exchange(
                            name = "normal-exchange",
                            type = ExchangeTypes.DIRECT
                    ),
                    key = "x"
            )
    )
    public void handlerMsg(String msg){

    }

}
